<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
                text-align: right;
            }

            .col-item {
                text-align: right;
                width: 125px;
            }

            .col-item2 {
                text-align: right;
                width: 191px;
            }

            .col-item3 {
                text-align: right;
                width: 200px;
            }

            .col-item-input {
                text-align: left;
            }
        </style>
        <script language="JavaScript" type="text/JavaScript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    event.keyCode = 9;
                }
            }
        </script>
    </ui:define>

    <ui:define name="content">
        <h:form id="form">

            <p:fieldset legend="票据主信息">
                <p:focus for="billId"/>
                <p:growl id="msgs" showDetail="false" life="5000"/>
                <h:panelGrid id="dataPanel" columns="1" style="width: 100%;">
                    <h:panelGrid id="infoPanel" columns="6" cellpadding="0" cellspacing="5" border="0"
                                 style="width:100%;"
                                 columnClasses="col-label, col-item-input, col-label, col-item-input, col-label, col-item-input">
                        <h:outputLabel value="缴款通知书号:" style="text-align: right;"/>
                        <p:inputText id="billId" value="#{payinWarrantAction.warrantInfo.billId}" required="true"
                                     requiredMessage="必须输入缴款通知书号"/>

                        <h:outputLabel value="票据类型:" style="text-align: right;"/>
                        <p:inputText id="voucherType" value="#{payinWarrantAction.warrantInfo.voucherType}"
                                     required="true"
                                     requiredMessage="必须输入票据类型"/>

                        <h:outputLabel value="单位代码:"/>
                        <p:inputText id="instCode" value="#{payinWarrantAction.warrantInfo.instCode}"/>

                        <h:outputLabel value="缴款人:"/>
                        <p:inputText value="#{payinWarrantAction.warrantInfo.payerName}" id="payerName"/>
                        <h:outputLabel value="通知日期:"/>
                        <p:inputText id="notifyDate" value="#{payinWarrantAction.warrantInfo.notifyDate}"/>
                        <h:outputLabel value="最迟日期:"/>
                        <p:inputText value="#{payinWarrantAction.warrantInfo.latestDate}" id="latestDate"/>
                        <h:outputLabel value="校验码:"/>
                        <p:inputText id="verifyNo" value="#{payinWarrantAction.warrantInfo.verifyNo}"/>
                    </h:panelGrid>
                </h:panelGrid>
            </p:fieldset>
            <br/>
            <p:fieldset legend="票据缴费项目" style="width: 100%">
                <br/>
                <p:panel>
                    <h:panelGrid id="itemPanel1" columns="4" cellpadding="0" cellspacing="5" border="0"
                                 columnClasses="col-item, col-item-input, col-item2, col-item-input">
                        <h:outputLabel value="项目编码:"/>
                        <p:inputText value="#{payinWarrantAction.item1.prjCode}"
                                     required="true" requiredMessage="必须输入项目编码"/>
                        <h:outputLabel value="计量单位:"/>
                        <p:inputText value="#{payinWarrantAction.item1.measure}"/>
                        <h:outputLabel value="数量:"/>
                        <p:inputText value="#{payinWarrantAction.item1.handleNum}"
                                     required="true" requiredMessage="必须输入数量"/>
                        <h:outputLabel value="金额(元):"/>
                        <p:inputText value="#{payinWarrantAction.item1.txnAmt}"
                                     required="true" requiredMessage="必须输入金额"/>
                    </h:panelGrid>
                </p:panel>
                <br/>
                <p:panel>
                    <h:panelGrid id="itemPanel2" columns="4" cellpadding="0" cellspacing="5" border="0"
                                 columnClasses="col-item, col-item-input, col-item2, col-item-input">
                        <h:outputLabel value="项目编码:"/>
                        <p:inputText value="#{payinWarrantAction.item2.prjCode}"/>
                        <h:outputLabel value="计量单位:"/>
                        <p:inputText value="#{payinWarrantAction.item2.measure}"/>
                        <h:outputLabel value="数量:"/>
                        <p:inputText value="#{payinWarrantAction.item2.handleNum}"/>
                        <h:outputLabel value="金额(元):"/>
                        <p:inputText value="#{payinWarrantAction.item2.txnAmt}"/>
                    </h:panelGrid>
                </p:panel>
                <br/>
                <p:panel>
                    <h:panelGrid id="itemPanel3" columns="4" cellpadding="0" cellspacing="5" border="0"
                                 columnClasses="col-item, col-item-input, col-item2, col-item-input">
                        <h:outputLabel value="项目编码:"/>
                        <p:inputText value="#{payinWarrantAction.item3.prjCode}"/>
                        <h:outputLabel value="计量单位:"/>
                        <p:inputText value="#{payinWarrantAction.item3.measure}"/>
                        <h:outputLabel value="数量:"/>
                        <p:inputText value="#{payinWarrantAction.item3.handleNum}"/>
                        <h:outputLabel value="金额(元):"/>
                        <p:inputText value="#{payinWarrantAction.item3.txnAmt}"/>
                    </h:panelGrid>
                </p:panel>
                <br/>
                <p:panel>
                    <h:panelGrid id="itemPanel4" columns="4" cellpadding="0" cellspacing="5" border="0"
                                 columnClasses="col-item, col-item-input, col-item2, col-item-input">
                        <h:outputLabel value="项目编码:"/>
                        <p:inputText value="#{payinWarrantAction.item4.prjCode}"/>
                        <h:outputLabel value="计量单位:"/>
                        <p:inputText value="#{payinWarrantAction.item4.measure}"/>
                        <h:outputLabel value="数量:"/>
                        <p:inputText value="#{payinWarrantAction.item4.handleNum}"/>
                        <h:outputLabel value="金额(元):"/>
                        <p:inputText value="#{payinWarrantAction.item4.txnAmt}"/>
                    </h:panelGrid>
                </p:panel>
                <br/>
                <p:panel>
                    <h:panelGrid id="itemPanel5" columns="4" cellpadding="0" cellspacing="5" border="0"
                                 columnClasses="col-item, col-item-input, col-item2, col-item-input">
                        <h:outputLabel value="项目编码:"/>
                        <p:inputText value="#{payinWarrantAction.item5.prjCode}"/>
                        <h:outputLabel value="计量单位:"/>
                        <p:inputText value="#{payinWarrantAction.item5.measure}"/>
                        <h:outputLabel value="数量:"/>
                        <p:inputText value="#{payinWarrantAction.item5.handleNum}"/>
                        <h:outputLabel value="金额(元):"/>
                        <p:inputText value="#{payinWarrantAction.item5.txnAmt}"/>
                    </h:panelGrid>
                </p:panel>
                <br/>
            </p:fieldset>
            <p:ajaxStatus style="height:18px;text-align:center">
                <f:facet name="start">
                    <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                </f:facet>
                <f:facet name="complete">
                    <h:outputText value=""/>
                </f:facet>
            </p:ajaxStatus>
            <p:separator/>
            <h:panelGrid columns="2">
                <p:commandButton id="cfmbtn" style="width: 100px;margin-left: 400px;"
                                 action="#{payinWarrantAction.onHandWritenPayConfirm}"
                                 value="缴款验证" disabled="#{payinWarrantAction.confirmed}" update="msgs,paybtn,cfmbtn"/>
                <p:commandButton id="paybtn" style="width: 100px;margin-left: 10px;"
                                 disabled="#{!payinWarrantAction.confirmed}"
                                 action="#{payinWarrantAction.onHandWritenPay}"
                                 value="确认缴款" update="msgs,paybtn,cfmbtn"/>
            </h:panelGrid>
        </h:form>
    </ui:define>
</ui:composition>